$('document').ready(function () {

    //跳转到充值页面
    $('#PayFor').click(function () {
        $(window).attr('location', 'myPay/index.do');
    });

    //查询账单信息
    function QueryZD() {
        $.ajax({
            type: 'GET',
            url: "main/topBill",
            async: "true",
//                    contentType: "application/x-www-form-urlencoded; charset=utf-8",
            success: function (data) {
                var dataObj = eval("(" + data + ")");
                for (var i = 0; i < dataObj.length; i++) {
                    $('#tablist tbody').append("<tr><td>" + dataObj[i].billDateStr + "</td><td>" + dataObj[i].amt + "</td><td>" + dataObj[i].paidAmt + "</td><td>" + dataObj[i].statusStr + "</td><td>" + dataObj[i].overDueDays + "</td></tr>")
                }
            },
            error: function () {
                for (var i = 0; i < 5; i++) {
                    $('#tablist tbody').append("<tr><td>" + (i + 1) + "</td><td>0</td><td>0</td><td>0</td><td>0</td></tr>")
                }
            }
        });
    }

    QueryZD();

});